<?php 
namespace app\admin\validate;
use think\validate;
class ShopApplyValidate extends Validate{
    //验证规则
    protected $rule = array(
		'shop_id'=>'number',
		'apply_type'=>'number',
		'member_id'=>'require|number',
		'company_name' => 'max:50',
		'user_name' => 'max:50',
		'province_id'=>'number',
		'city_id'=>'number',
		'district_id'=>'number',
		'address_detail' => 'max:50',
		'company_phone'=>'regex:^1[356789]\d{9}',
		'company_type' => 'max:255',
		'company_employee_count'=>'number',
		'company_registered_capital'=>'number',
		'contacts_name' => 'max:50',
		'contacts_phone'=>'regex:^1[356789]\d{9}',
		'contacts_email'=>'email',
			'contacts_card_no' => 'max:255',
		'contacts_card_electronic_1' => 'max:255',
		'contacts_card_electronic_2' => 'max:255',
		'contacts_card_electronic_3' => 'max:255',
		'business_licence_number' => 'max:50',
		'business_sphere' => 'max:1000',
		'business_licence_number_electronic' => 'max:50',
		'organization_code' => 'max:50',
		'organization_code_electronic' => 'max:50',
		'general_taxpayer' => 'max:255',
		'bank_account_name' => 'max:50',
		'bank_account_number' => 'max:50',
		'bank_name' => 'max:50',
		'bank_code' => 'max:50',
		'bank_address' => 'max:50',
		'bank_licence_electronic' => 'max:50',
    		'settlement_bank_account_name' => 'max:50',
		'settlement_bank_account_number' => 'max:50',
		'settlement_bank_name' => 'max:50',
		'settlement_bank_code' => 'max:50',
		'settlement_bank_address' => 'max:50',
		'tax_registration_certificate' => 'max:50',
		'tax_registration_certificate_electronic' => 'max:50',
		'taxpayer_id' => 'max:50',
		'shop_name' => 'max:50',
		'apply_status' => 'max:50',
		'apply_message' => 'max:200',
    		'shop_type_name' => 'max:50',
		'shop_type_id'=>'number',
		'shop_group_name' => 'max:50',
		'shop_group_id'=>'number',
		'paying_money_certificate' => 'max:50',
		'paying_money_certificate_explain' => 'max:200',
		'paying_amount'=>'regex:\d+\.?\d{0,2}',
		'recommend_uid'=>'number',
	);
    //验证失败提示信息
    protected $message = array(
		'shop_id.number'=>'店铺ID申请成功之前为0的值必须是一个整数',
		'apply_type.number'=>'申请类型1.个人2.公司的值必须是一个整数',
		'member_id.require'=>'用户编号不能为空',
		'member_id.number'=>'用户编号的值必须是一个整数',
		'company_name.max'=>'公司名称的值不能超过50个字符',
		'user_name.max'=>'店主用户名的值不能超过50个字符',
		'province_id.number'=>'所在地省ID的值必须是一个整数',
		'city_id.number'=>'所在地市ID的值必须是一个整数',
		'district_id.number'=>'所在地区ID的值必须是一个整数',
		'address_detail.max'=>'公司详细地址的值不能超过50个字符',
		'company_phone.regex'=>'公司电话的值不是正确的手机号码',
		'company_type.max'=>'私企.个体.外企.中外合资的值不能超过255个字符',
		'company_employee_count.number'=>'员工总数的值必须是一个整数',
		'company_registered_capital.number'=>'注册资金的值必须是一个整数',
		'contacts_name.max'=>'联系人姓名的值不能超过50个字符',
		'contacts_phone.regex'=>'联系人电话的值不是正确的手机号码',
		'contacts_email.email'=>'联系人邮箱的值不是正确的邮箱格式',
		'contacts_card_no.max'=>'申请人身份证号的值不能超过255个字符',
		'contacts_card_electronic_1.max'=>'申请人手持身份证电子版的值不能超过255个字符',
		'contacts_card_electronic_2.max'=>'申请人身份证正面的值不能超过255个字符',
		'contacts_card_electronic_3.max'=>'申请人身份证反面的值不能超过255个字符',
		'business_licence_number.max'=>'营业执照号的值不能超过50个字符',
		'business_sphere.max'=>'法定经营范围的值不能超过1000个字符',
		'business_licence_number_electronic.max'=>'营业执照电子版的值不能超过50个字符',
		'organization_code.max'=>'组织机构代码的值不能超过50个字符',
		'organization_code_electronic.max'=>'组织机构代码电子版的值不能超过50个字符',
		'general_taxpayer.max'=>'一般纳税人证明的值不能超过255个字符',
		'bank_account_name.max'=>'银行开户名的值不能超过50个字符',
		'bank_account_number.max'=>'公司银行账号的值不能超过50个字符',
		'bank_name.max'=>'开户银行支行名称的值不能超过50个字符',
		'bank_code.max'=>'支行联行号的值不能超过50个字符',
		'bank_address.max'=>'开户银行所在地的值不能超过50个字符',
		'bank_licence_electronic.max'=>'开户银行许可证电子版的值不能超过50个字符',
		'settlement_bank_account_name.max'=>'结算银行开户名的值不能超过50个字符',
		'settlement_bank_account_number.max'=>'结算公司银行账号的值不能超过50个字符',
		'settlement_bank_name.max'=>'结算开户银行支行名称的值不能超过50个字符',
		'settlement_bank_code.max'=>'结算支行联行号的值不能超过50个字符',
		'settlement_bank_address.max'=>'结算开户银行所在地的值不能超过50个字符',
		'tax_registration_certificate.max'=>'税务登记证号的值不能超过50个字符',
		'tax_registration_certificate_electronic.max'=>'税务登记证号电子版的值不能超过50个字符',
		'taxpayer_id.max'=>'纳税人识别号的值不能超过50个字符',
		'shop_name.max'=>'店铺名称的值不能超过50个字符',
		'apply_status.max'=>'申请状态 0-已提交申请 1-审核成功 2-审核失败的值不能超过50个字符',
		'apply_message.max'=>'管理员审核信息的值不能超过200个字符',
		'shop_type_name.max'=>'店铺等级名称的值不能超过50个字符',
		'shop_type_id.number'=>'店铺等级id的值必须是一个整数',
		'shop_group_name.max'=>'店铺分类名称的值不能超过50个字符',
		'shop_group_id.number'=>'店铺分类ID的值必须是一个整数',
		'paying_money_certificate.max'=>'付款凭证的值不能超过50个字符',
		'paying_money_certificate_explain.max'=>'付款凭证说明的值不能超过200个字符',
		'paying_amount.regex'=>'付款金额的值不是正确的货币格式',
		'recommend_uid.number'=>'推荐招商员用户id的值必须是一个整数',
);
    //验证场景
    protected $scene = array(
		'add'=>array('shop_id','apply_type','member_id','company_name','user_name','province_id','city_id','district_id','address_detail','company_phone','company_type','company_employee_count','company_registered_capital','contacts_name','contacts_phone','contacts_email','contacts_card_no','contacts_card_electronic_1','contacts_card_electronic_2','contacts_card_electronic_3','business_licence_number','business_sphere','business_licence_number_electronic','organization_code','organization_code_electronic','general_taxpayer','bank_account_name','bank_account_number','bank_name','bank_code','bank_address','bank_licence_electronic','is_settlement_account','settlement_bank_account_name','settlement_bank_account_number','settlement_bank_name','settlement_bank_code','settlement_bank_address','tax_registration_certificate','tax_registration_certificate_electronic','taxpayer_id','shop_name','apply_status','apply_message','apply_year','shop_type_name','shop_type_id','shop_group_name','shop_group_id','paying_money_certificate','paying_money_certificate_explain','paying_amount','recommend_uid'),
		'edit'=>array('apply_id','shop_id','apply_type','member_id','company_name','user_name','province_id','city_id','district_id','address_detail','company_phone','company_type','company_employee_count','company_registered_capital','contacts_name','contacts_phone','contacts_email','contacts_card_no','contacts_card_electronic_1','contacts_card_electronic_2','contacts_card_electronic_3','business_licence_number','business_sphere','business_licence_number_electronic','organization_code','organization_code_electronic','general_taxpayer','bank_account_name','bank_account_number','bank_name','bank_code','bank_address','bank_licence_electronic','is_settlement_account','settlement_bank_account_name','settlement_bank_account_number','settlement_bank_name','settlement_bank_code','settlement_bank_address','tax_registration_certificate','tax_registration_certificate_electronic','taxpayer_id','shop_name','apply_status','apply_message','apply_year','shop_type_name','shop_type_id','shop_group_name','shop_group_id','paying_money_certificate','paying_money_certificate_explain','paying_amount','recommend_uid'),
	);

}